//
//  ZCMVUpdataTbaleViewCell.m
//  VoiceMusic
//
//  Created by dllo on 15/10/16.
//  Copyright © 2015年 zhangdeyu. All rights reserved.
//

#import "ZCMVUpdataTbaleViewCell.h"
#import <Masonry.h>
#import "ZCBaseLabel.h"
#import "ZCBaseView.h"
#import <UIImageView+WebCache.h>
@implementation ZCMVUpdataTbaleViewCell

- (void)layoutSubviews
{
    [self superview];
    [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
    
    [self.picImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.backView).offset(35);
        make.right.equalTo(self.backView.mas_right).offset(-5);
        make.left.equalTo(self.backView.mas_left).offset(5);
        make.bottom.equalTo(self.backView.mas_bottom).offset(-40);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.backView).offset(0);
        make.left.equalTo(self.backView.mas_left).offset(5);
        make.right.equalTo(self.backView).offset(0);
        make.height.equalTo(@30);
    }];
    [self.titleLabel setFont:[UIFont boldSystemFontOfSize:24]];
    
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.picImageView).offset(70);
        make.bottom.equalTo(self.picImageView).offset(-70);
        make.left.equalTo(self.picImageView).offset(140);
        make.right.equalTo(self.picImageView).offset(-140);
    }];

    [self.firstLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.picImageView.mas_bottom).offset(-3);
        make.bottom.equalTo(self.backView.mas_bottom).offset(0);
        make.left.right.equalTo(self.backView).offset(0);
    }];
    [self.firstLabel setNumberOfLines:0];
    [self.firstLabel setFont:[UIFont systemFontOfSize:15]];
    self.firstLabel.alpha = 0.6;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)getInfo:(ZCMVModel *)model
{
    [self.iconImageView setImage:[UIImage imageNamed:@"baibofang"]];
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.bigPicUrl] placeholderImage:[UIImage imageNamed:@"50.png"]];
    NSString *str = [NSString stringWithFormat:@"曲名: %@", model.videoName];
    [self.titleLabel setText:str];
//    NSString *string = [NSString stringWithFormat:@"发行日期: %@", model.title];
//    [self.detailLabel setText:string];
    NSString *stringOne = [NSString stringWithFormat:@"简介: %@", model.desc];
    [self.firstLabel setText:stringOne];
}
@end
